package com.itheima_06;

public class MyThread extends Thread {
    private int ticket = 100;

    @Override
    public void run() {
        while (true){
            if (ticket>0) {
                System.out.println(Thread.currentThread().getName() + "在买票,还剩" + ticket + "张");
                ticket--;
            }else {
                break;
            }
        }
    }
}
